kbuild: Add build salt to the kernel and modules
authorLaura Abbott <labbott@redhat.com>
Fri, 6 Jul 2018 00:49:37 +0000 (17:49 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 18 Aug 2018 12:02:58 +0000 (13:02 +0100)
commit8563b48c4c1932174498399390d463c0790a9b21
tree53563ccc9b8ce8918f40865c13107c5ba44bfb01
parentae45d9a049d7df00ef515ee35708254bc473966b
kbuild: Add build salt to the kernel and modules

In Fedora, the debug information is packaged separately (foo-debuginfo) and
can be installed separately. There's been a long standing issue where only
one version of a debuginfo info package can be installed at a time. There's
been an effort for Fedora for parallel debuginfo to rectify this problem.

Part of the requirement to allow parallel debuginfo to work is that build ids
are unique between builds. The existing upstream rpm implementation ensures
this by re-calculating the build-id using the version and release as a
seed. This doesn't work 100% for the kernel because of the vDSO which is
its own binary and doesn't get updated when embedded.

Fix this by adding some data in an ELF note for both the kernel and modules.
The data is controlled via a Kconfig option so distributions can set it
to an appropriate value to ensure uniqueness between builds.

Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Gbp-Pq: Topic features/all
Gbp-Pq: Name kbuild-add-build-salt-to-the-kernel-and-modules.patch
include/linux/build-salt.h [new file with mode: 0644]
init/Kconfig
init/version.c
scripts/mod/modpost.c